//
//  SPTagsTokenFieldDelegate.h
//  Sophie
//
//  Created by Anton Chebotaev on 22/10/09.
//  Copyright 2009 IFMO. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <LJClientKit/LJClientKit.h>
#import "SPAccountController.h"

@interface SPTagsManager : NSObject <NSTokenFieldDelegate> {
	LJEntry *entry;

	NSMutableArray *selectedTags;
}

@property (readwrite, assign) LJEntry *entry;

#pragma mark NSTextFieldDelegate
// Allways returns NO
- (BOOL)tokenField:(NSTokenField *)tokenField hasMenuForRepresentedObject:(id)representedObject;

// Returns tag's name
- (NSString *)tokenField:(NSTokenField *)tokenField editingStringForRepresentedObject:(id)representedObject;
- (NSString *)tokenField:(NSTokenField *)tokenField displayStringForRepresentedObject:(id)representedObject;

// Completes string
- (NSArray *)tokenField:(NSTokenField *)tokenField completionsForSubstring:(NSString *)substring indexOfToken:(NSInteger)tokenIndex indexOfSelectedItem:(NSInteger *)selectedIndex;

// Generating tags
- (id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString:(NSString *)editingString;

@end
